//
//  DealQuestionViewController.m
//  TeamInformatization
//
//  Created by bigger on 2019/4/6.
//  Copyright © 2019年 SPIC. All rights reserved.
//

#import "DealQuestionViewController.h"
#import "WorkQuestionView.h"
#import "TakePhotoRecordingView.h"

@interface DealQuestionViewController ()

@end

@implementation DealQuestionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
     [self showTitleBarWithTitle:@"处理反馈" leftButtonStyle:Base_NavigationBar_Back rightButtonStyle:Base_NavigationBar_None];
    
    // UI
    [self loadShowViews];
}

- (void)loadShowViews
{
    UIScrollView * bgScrollView = [[UIScrollView alloc] init];
    bgScrollView.backgroundColor = kCommonBGGaryColor;
    bgScrollView.bounces = NO;
    bgScrollView.showsVerticalScrollIndicator = NO;
    bgScrollView.userInteractionEnabled = YES;
    bgScrollView.contentSize = CGSizeMake(kScreenWidth, kScreenHeight * 2);
    [self.view addSubview:bgScrollView];
    [bgScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(kSafeAreaTopHeight);
        make.left.right.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
    }];
    
    
    WorkQuestionView *workQuestionView = [[WorkQuestionView alloc] initWithShowType:2];
    [bgScrollView addSubview:workQuestionView];
    [workQuestionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.centerX.mas_equalTo(bgScrollView);
        make.width.mas_equalTo(kScreenWidth);
    }];
    
    
    UIView *bgTitleView = [[UIView alloc] init];
    bgTitleView.backgroundColor = [UIColor whiteColor];
    [bgScrollView addSubview:bgTitleView];
    [bgTitleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(workQuestionView.mas_bottom).offset(15 * kScaleWidth);
        make.size.mas_equalTo(CGSizeMake(kScreenWidth, 47 * kScaleWidth));
    }];
    
    SimpleLabel *titleLabel = [SimpleLabel initWithText:@"整改处理:" TextColor:kTitleTextColor TextFont:kFont(PFSCRegular, 15) TextAlignment:NSTextAlignmentLeft];
    [bgTitleView addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15 * kScaleWidth);
        make.top.mas_equalTo(0);
        make.height.mas_equalTo(47 * kScaleWidth);
    }];
    
    
    TakePhotoRecordingView *workView = [[TakePhotoRecordingView alloc] init];
    [bgScrollView addSubview:workView];
    [workView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(bgTitleView.mas_bottom);
        make.left.mas_equalTo(0);
        make.width.mas_equalTo(kScreenWidth);
    }];
    
    // 完成提交
    UIButton *finishDealButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [finishDealButton setCommonStyleAndShowText:@"整改完成"];
    [finishDealButton addTarget:self action:@selector(finishDealAction:) forControlEvents:UIControlEventTouchUpInside];
    [bgScrollView addSubview:finishDealButton];
    [finishDealButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(workView.mas_bottom).offset(35 * kScaleWidth);
        make.bottom.mas_equalTo(-31 * kScaleWidth);
        make.centerX.mas_equalTo(self.view);
        make.size.mas_equalTo(CGSizeMake(kScreenWidth - 20 * kScaleWidth, 44 * kScaleWidth));
    }];
}

// 整改完成
- (void)finishDealAction:(UIButton *)sender
{
    
}

#pragma -导航栏 两边按钮操作
-(void)baseNavigationBarLeftButtonClick:(UIButton *)button
{
    [self.navigationController popViewControllerAnimated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
